#include "free_queue.h"
#include <stdio.h>

int main() {
    if (!shm_lock_free_queue_init(128)) {
        fprintf(stderr, "Failed to initialize shared memory lock-free queue\n");
        return 1;
    }

    char data[128];
    while (1) {
        if (shm_lock_free_queue_read(data, sizeof(data))) {
            printf("Consumed: %s\n", data);
        } else {
            sleep(1);
        }
    }
    shm_lock_free_queue_destroy();
    return 0;
}
